/**
  ******************************************************************************
  * @file 
  * @brief 
  * @author luffy
  * @version V1.0.0
  * @date 2022/11/29
  ******************************************************************************
  */
#ifndef _TCA6416_H
#define _TCA6416_H 

#include "dev_include.h"

/* private config -----------------------------------------------------------*/
typedef struct
{
    drv_i2c_t       i2c;
}tca6416_private_t;

/* Public defines -----------------------------------------------------------*/
typedef struct dev_tca6416  dev_tca6416_t;

/* Public enum    -----------------------------------------------------------*/
typedef enum
{
    TCA6416_P00 = 0x0001,
    TCA6416_P01 = 0x0002,
    TCA6416_P02 = 0x0004,
    TCA6416_P03 = 0x0008,
    TCA6416_P04 = 0x0010,
    TCA6416_P05 = 0x0020,
    TCA6416_P06 = 0x0040,
    TCA6416_P07 = 0x0080,

    TCA6416_P10 = 0x0100,
    TCA6416_P11 = 0x0200,
    TCA6416_P12 = 0x0400,
    TCA6416_P13 = 0x0800,
    TCA6416_P14 = 0x1000,
    TCA6416_P15 = 0x2000,
    TCA6416_P16 = 0x4000,
    TCA6416_P17 = 0x8000,
}tca6416_pin_e;

typedef enum
{
    TCA6416_INPUT,
    TCA6416_OUTPUT,
}tca6416_mode_e;


/* Public Struct  -----------------------------------------------------------*/
struct dev_tca6416
{
    /* ***************Public Parameter  *************** */
    const char *    PIN_SDA;
    const char *    PIN_SCL;

    uint8_t         SLAVE_ADDR;
    void         ( *Int_Callback )   (void);
    /* ***************Public Method     *************** */
    int     ( *Check     )   ( dev_tca6416_t * );
    void    ( *ModeSetBit)   ( dev_tca6416_t *, tca6416_mode_e,    uint16_t );
    void    ( *WriteBit  )   ( dev_tca6416_t *, uint8_t,           uint16_t );
    uint8_t ( *ReadBit   )   ( dev_tca6416_t *, tca6416_pin_e );

    /* ***************Private Attributes*************** */
    tca6416_private_t  private;
};


/* Public Variable  ---------------------------------------------------------*/
//Pointer

//Array

//Const



/* Pubilc function prototypes -----------------------------------------------*/
int     Dev_Tca6416_Init    (dev_tca6416_t *this);
	
#endif

